/***************************************************************************
* *   File name: DemoPlugin.cpp
* *    Describe: 业务功能实现类
* *  Created on: 2016-8-6
* *      Author: dengxiudong
* ************************************************************************/ 
#include "DemoPlugin.h"

#include "Protocol.h"

DemoPlugin::DemoPlugin():m_ptrDemo(new Demo)
{
	m_cmdCode=1;
}

DemoPlugin::~DemoPlugin()
{
	if (m_ptrDemo!=nullptr)
	{
		delete m_ptrDemo;
	}
}

/**
*\brief  初始化插件，将插件置于可执行任务状态
*\return 操作结果
*/
bool DemoPlugin::initPlugin()
{
	//setCmdCode(1);
	//registFunc(1,aaa);
}

/**
*\brief 结束任务，停止插件执行
*/
void DemoPlugin::stopPlugin()
{
}

extern "C" {

	static IPlugin* g_ptrPlugin = NULL;
	void* CreatePluginInstance()
	{
		g_ptrPlugin = new DemoPlugin();
		return g_ptrPlugin;
	}

	void DestoryPluginInstance()
	{
		if (g_ptrPlugin)
		{
			g_ptrPlugin->release();
		}
	}
};





